# -*- coding: utf-8 -*-
"""
Created on Fri Jan 11 18:48:25 2013

@author: nzhao
"""
from traits.api import Range, Enum
from numpy import sin, cos, linspace

from data_viewer import DataViewer
from curves import CurveData

new_curve_para1={'w1': Range(low=1.0, high=10.0, value=1.0) }
new_curve_face1 = {'color': 'red', 'type': 'scatter'}

class new_curve1(CurveData):
    def kernerl(self):
        self.ylist = sin(self.w1 * self.xlist)

new_curve_para2={'w2': Range(low=1.0, high=10.0, value=1.0) }
new_curve_face2 = {'color': 'blue', 'type': 'line'}
class new_curve2(CurveData):
    def kernerl(self):
        self.ylist = cos(self.w2 * self.xlist)


new_curve_para3={'w3': Enum(1., 2., 3., 4.) }
new_curve_face3 = {'color': 'green', 'type': 'line_scatter'}
class new_curve3(CurveData):
    def kernerl(self):
        self.ylist = cos(self.w3 * self.xlist)

new_c1 = new_curve1(x=linspace(0,1,100), name='sin', parameters=new_curve_para1, face = new_curve_face1)
new_c2 = new_curve2(x=linspace(0,1,100), name='cos', parameters=new_curve_para2, face = new_curve_face2)
new_c3 = new_curve3(x=linspace(0,1,100), name='cos1', parameters=new_curve_para3, face = new_curve_face3)
new_c4 = CurveData(name='datafrmfile',  mode='file')

p=DataViewer()
p.data.add_curve(new_c1)
p.data.add_curve(new_c2)
p.data.add_curve(new_c3)
p.data.add_curve(new_c4)

p.configure_traits()     